<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .clock {
      width: 200px;
      height: 200px;
      border: 1px solid;
      border-radius: 50%;
      position: relative;
    }
    .kd {
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -1px;
      margin-top: -2px;
      width: 2px;
      height: 4px;
      /* transform: translateY(-97px); */
      /* transform: rotate(90deg) translateY(-97px); */
      background: #000;
    }
    .h, .m, .s {
      position: absolute;
      height: 4px;
      top: 50%;
      background: #000;
      margin-top: -2px;
      left: 50%;
      margin-left: -5px;
      transform-origin: 5px 2px;
    }
    .h {
      width: 40px;
      transform: rotate(30deg);
    }
    .m {
      width: 55px;
      transform: rotate(45deg);
    }
    .s {
      width: 70px;
      height: 2px;
      margin-top: -1px;
      background: red;
    }
  </style>
</head>
<body>
  <div class="clock">
    <i class="h"></i>
    <i class="m"></i>
    <i class="s"></i>
  </div>
  <script>
    var clock = document.querySelector('.clock')
    for (var i = 0; i < 60; i++) {
      var kd = document.createElement('i');
      kd.className = 'kd'
      clock.appendChild(kd)
      kd.style.transform = "rotate(" + i*6 + "deg) translateY(-98px)"
    } 
  

    function getDate () {
      var 
        d = new Date(),
        h = d.getHours(),
        m = d.getMinutes(),
        s = d.getSeconds()
      return {
        h: h, m: m, s: s
      }
    } 

    function draw () {
      var h = document.querySelector('.h')
      var m = document.querySelector('.m')
      var s = document.querySelector('.s')
      
      var date = getDate()

      var hdeg = date.h * 30 - 90
      var mdeg = date.m * 6 - 90
      var sdeg = date.s * 6 - 90
      console.log(hdeg)
      h.style.transform = "rotate(" + hdeg + "deg)"
      m.style.transform = "rotate(" + mdeg + "deg)"
      s.style.transform = "rotate(" + sdeg + "deg)"
    }
    draw()
    setInterval(function () {
      draw()
    }, 1000)

  </script>
</body>
</html>